.class public Luk/co/deanwild/materialshowcaseview/CircleShape;
.super Ljava/lang/Object;
.source "CircleShape.java"

# interfaces
.implements Luk/co/deanwild/materialshowcaseview/Shape;


# instance fields
.field private radius:I


# direct methods
.method public constructor <init>(I)V
    .locals 1

    .line 16
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/16 v0, 0xd2

    .line 13
    iput v0, p0, Luk/co/deanwild/materialshowcaseview/CircleShape;->radius:I

    .line 17
    iput p1, p0, Luk/co/deanwild/materialshowcaseview/CircleShape;->radius:I

    return-void
.end method

.method public constructor <init>(Landroid/graphics/Rect;)V
    .locals 0

    .line 21
    invoke-static {p1}, Luk/co/deanwild/materialshowcaseview/CircleShape;->getPreferredRadius(Landroid/graphics/Rect;)I

    move-result p1

    invoke-direct {p0, p1}, Luk/co/deanwild/materialshowcaseview/CircleShape;-><init>(I)V

    return-void
.end method

.method public constructor <init>(Luk/co/deanwild/materialshowcaseview/Target;)V
    .locals 0

    .line 25
    invoke-interface {p1}, Luk/co/deanwild/materialshowcaseview/Target;->getBounds()Landroid/graphics/Rect;

    move-result-object p1

    invoke-direct {p0, p1}, Luk/co/deanwild/materialshowcaseview/CircleShape;-><init>(Landroid/graphics/Rect;)V

    return-void
.end method

.method public static getPreferredRadius(Landroid/graphics/Rect;)I
    .locals 6

    .line 40
    invoke-virtual {p0}, Landroid/graphics/Rect;->width()I

    move-result v0

    int-to-double v0, v0

    .line 41
    invoke-virtual {p0}, Landroid/graphics/Rect;->height()I

    move-result p0

    int-to-double v2, p0

    const-wide/high16 v4, 0x4000000000000000L    # 2.0

    .line 42
    invoke-static {v0, v1, v4, v5}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v0

    invoke-static {v2, v3, v4, v5}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v2

    add-double/2addr v0, v2

    invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v0

    double-to-int p0, v0

    div-int/lit8 p0, p0, 0x2

    add-int/lit8 p0, p0, 0x1

    return p0
.end method


# virtual methods
.method public draw(Landroid/graphics/Canvas;Landroid/graphics/Paint;II)V
    .locals 1

    int-to-float p3, p3

    int-to-float p4, p4

    .line 30
    iget v0, p0, Luk/co/deanwild/materialshowcaseview/CircleShape;->radius:I

    int-to-float v0, v0

    invoke-virtual {p1, p3, p4, v0, p2}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V

    return-void
.end method

.method public pointInBounds(FFLuk/co/deanwild/materialshowcaseview/Target;)Z
    .locals 4

    .line 47
    invoke-interface {p3}, Luk/co/deanwild/materialshowcaseview/Target;->getPoint()Landroid/graphics/Point;

    move-result-object p3

    .line 48
    iget v0, p3, Landroid/graphics/Point;->x:I

    int-to-float v0, v0

    sub-float/2addr v0, p1

    float-to-double v0, v0

    const-wide/high16 v2, 0x4000000000000000L    # 2.0

    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v0

    iget p1, p3, Landroid/graphics/Point;->y:I

    int-to-float p1, p1

    sub-float/2addr p1, p2

    float-to-double p1, p1

    invoke-static {p1, p2, v2, v3}, Ljava/lang/Math;->pow(DD)D

    move-result-wide p1

    add-double/2addr v0, p1

    invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide p1

    iget p3, p0, Luk/co/deanwild/materialshowcaseview/CircleShape;->radius:I

    int-to-double v0, p3

    cmpg-double p3, p1, v0

    if-gez p3, :cond_0

    const/4 p1, 0x1

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    :goto_0
    return p1
.end method

.method public updateTarget(Luk/co/deanwild/materialshowcaseview/Target;)V
    .locals 0

    .line 35
    invoke-interface {p1}, Luk/co/deanwild/materialshowcaseview/Target;->getBounds()Landroid/graphics/Rect;

    move-result-object p1

    invoke-static {p1}, Luk/co/deanwild/materialshowcaseview/CircleShape;->getPreferredRadius(Landroid/graphics/Rect;)I

    move-result p1

    iput p1, p0, Luk/co/deanwild/materialshowcaseview/CircleShape;->radius:I

    return-void
.end method
